<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Demo/Mockups</title>
<style type="text/css">
body{background:url(blank.jpg) no-repeat center top; cursor:pointer; background-color:#FFF; }
.wrapper{height:1830px;}
</style>
</head>
<body>
<div class="wrapper" id="wrapper"></div>
<script type="text/javascript">
// Pre-download all images first
var images = new Array();
<?php
$design_files = glob('*.jpg');
$i = 0;
foreach($design_files as $df => $design_file)
{
	echo "\r\nimages[{$i}] = new Image(); images[{$i}].src = '{$design_file}';";
	++$i;
}
$max_counter = count($design_files);
echo "\r\nmax_counter={$max_counter};\r\n";
?>
var counter = 1;
function change_image()
{
	if(counter>=max_counter) counter=0;
	document.body.style.backgroundImage = "url('"+images[counter].src+"')";
	document.title = 'Demo - '+images[counter].src;
	++counter;
}
document.body.onclick = change_image;

/**
* Do the first loading
*/
document.body.style.backgroundImage = "url('"+images[0].src+"')";
document.title = 'Demo - '+images[0].src;
</script>
</body>
</html>